/****

    activequant - activestocks.eu

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


	contact  : contact@activestocks.eu
    homepage : http://www.activestocks.eu

****/
package org.activequant.container.report.statistics;

import java.util.Hashtable;

/**
 * An interface. Defines the following methods:
 * <ul>
 * <li>public String getStatisticsName();</li>
 * <li>public void compute(Hashtable&lt;String, Object&gt; aStack, Object anObject);</li>
 * </ul>
 * <br>
 * <b>History:</b><br>
 *  - [21.05.2009] Created (Ulrich Staudinger)<br>
 *
 *  @author Ulrich Staudinger
 */
public interface IStatisticsComputer {

    /**
     *
     * @return returns the name of the statistics computed, preferably
     * in human readable form.
     */
    public String getStatisticsName();

    /**
     * The compute method of a statistics computer is called from some context.
     * The exchange method of information between computers is the stack, which is also
     * passed to the computation. All objects that are passed into the stack should
     * produce a toString() value that makes sense and is indeed printable. 
     *
     *
     * @param aStack the computation contains the output from other statistics computers
     *  Several statistic computers can be chained and through the stack, reuse results from
     *  former computers
     * @param anObject this can be a balance book, a transaction book or any other object.
     *  If this computer cannot cope with the object, it should not set anything
     *  in the computation stack.
     *
     */
    public void compute(Hashtable<String, Object> aStack, Object anObject);
}
